<template>
	<view>
		<!-- #ifndef MP-WEIXIN -->
		<!-- <u-search v-bind="customizedAttrs" v-on="$listeners"></u-search> -->
		<!-- #endif -->
		
		<u-search :disabled="disabled" 
							:showAction="showAction" 
							:actionStyle="actionStyle" 
							:animation="true"
		          @custom="custom" 
							@click="$emit('click')" ></u-search>

		<!-- <uni-search-bar radius="18" placeholder="请输入关键字"></uni-search-bar> -->
	</view>
</template>

<script>
	export default {
		name:"dy-search",
		props:{
			showAction: {
				type: Boolean,
				default: false
			},
      actionStyle: {
        type: Object,
        default(){
          return {color: "#ffffff"}
        }
      },
			disabled: {
				type: Boolean,
				default: true
			},
			animation: {
				type: Boolean,
				default: true
			}
		},
		data() {
			return {
				keyword:'',
			};
		},
		// #ifdef MP-WEIXIN
		options: { styleIsolation: 'shared' },
		// #endif
		computed:{
			customizedAttrs() {
				return {
					showAction: this.showAction,
					actionStyle: this.actionStyle,
					disabled: this.disabled,
					animation: this.animation,
					// 支持传过来的size覆盖默认的size
					...this.$attrs,
				};
			},
		},
    created() {

    },
		methods: {
			custom(val) {
				console.log(val);
				this.$emit('custom', val)
			}
		}
	}
</script>

<style lang="scss" scoped>
::v-deep .uni-searchbar__cancel {
	color: #fff;
}
::v-deep .uni-searchbar {
	padding: 10rpx 20rpx 20rpx;
}
</style>
